<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: winTimer类 参考</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">类</a> &#124;
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-attribs">静态 Public 属性</a> &#124;
<a href="#friends">友元</a> &#124;
<a href="../../de/d95/classwin_timer-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">winTimer类 参考</div></div>
</div><!--header-->
<div class="contents">

<p>针对windows实现的timer  
 <a href="#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="../../d1/da6/win_timer_8hpp_source.html">winTimer.hpp</a>&gt;</code></p>
<div class="dynheader">
类 winTimer 继承关系图:</div>
<div class="dyncontent">
<div class="center"><img src="../../d9/d77/classwin_timer__inherit__graph.png" border="0" usemap="#awin_timer_inherit__map" alt="Inheritance graph"/></div>
<map name="awin_timer_inherit__map" id="awin_timer_inherit__map">
<area shape="rect" title="针对windows实现的timer" alt="" coords="5,347,205,843"/>
<area shape="rect" href="../../d2/d38/structi_timer.html" title="定时器定义接口" alt="" coords="10,5,201,299"/>
<area shape="poly" title=" " alt="" coords="108,314,108,347,103,347,103,314"/>
</map>
</div>
<div class="dynheader">
winTimer 的协作图:</div>
<div class="dyncontent">
<div class="center"><img src="../../d4/df5/classwin_timer__coll__graph.png" border="0" usemap="#awin_timer_coll__map" alt="Collaboration graph"/></div>
<map name="awin_timer_coll__map" id="awin_timer_coll__map">
<area shape="rect" title="针对windows实现的timer" alt="" coords="5,347,205,843"/>
<area shape="rect" href="../../d2/d38/structi_timer.html" title="定时器定义接口" alt="" coords="10,5,201,299"/>
<area shape="poly" title=" " alt="" coords="108,314,108,347,103,347,103,314"/>
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
类</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d07/structwin_timer_1_1st_timer_item.html">stTimerItem</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a14a1016e75bbce66e1e81223ebf97665" id="r_a14a1016e75bbce66e1e81223ebf97665"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a14a1016e75bbce66e1e81223ebf97665">winTimer</a> ()</td></tr>
<tr class="separator:a14a1016e75bbce66e1e81223ebf97665"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4dd755c4a63913f5a538bef27c8db26e" id="r_a4dd755c4a63913f5a538bef27c8db26e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4dd755c4a63913f5a538bef27c8db26e">winTimer</a> (long ms, bool oneShot)</td></tr>
<tr class="separator:a4dd755c4a63913f5a538bef27c8db26e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a61095eb931b08bc8dfce2c8eecce4962" id="r_a61095eb931b08bc8dfce2c8eecce4962"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a61095eb931b08bc8dfce2c8eecce4962">winTimer</a> (std::function&lt; void()&gt; fun, long ms, bool onShot=false)</td></tr>
<tr class="separator:a61095eb931b08bc8dfce2c8eecce4962"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf8ffcaf3863e53e1d0a46e661b038d6" id="r_acf8ffcaf3863e53e1d0a46e661b038d6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#acf8ffcaf3863e53e1d0a46e661b038d6">~winTimer</a> ()</td></tr>
<tr class="separator:acf8ffcaf3863e53e1d0a46e661b038d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af4ecf02c7dd3950a074813f12654b6a1" id="r_af4ecf02c7dd3950a074813f12654b6a1"><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#af4ecf02c7dd3950a074813f12654b6a1">operator()</a> () const</td></tr>
<tr class="memdesc:af4ecf02c7dd3950a074813f12654b6a1"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置和获取计时器计时长度  <br /></td></tr>
<tr class="separator:af4ecf02c7dd3950a074813f12654b6a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1f51621daa57a92e70b44e65ed2d6556" id="r_a1f51621daa57a92e70b44e65ed2d6556"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1f51621daa57a92e70b44e65ed2d6556">operator()</a> (long t)</td></tr>
<tr class="separator:a1f51621daa57a92e70b44e65ed2d6556"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e3b9ffad7b759f2df399d8d222808cb" id="r_a8e3b9ffad7b759f2df399d8d222808cb"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="../../d2/d38/structi_timer.html#a31bdd3250ca6c5542d0ec156bd82c5ab">emErrCode</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a8e3b9ffad7b759f2df399d8d222808cb">Start</a> (long ms=-1, bool oneShot=false) final</td></tr>
<tr class="memdesc:a8e3b9ffad7b759f2df399d8d222808cb"><td class="mdescLeft">&#160;</td><td class="mdescRight">启动或者重启计时器。  <br /></td></tr>
<tr class="separator:a8e3b9ffad7b759f2df399d8d222808cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20ee41eb7e75beb6f68dfaf4343c87f8" id="r_a20ee41eb7e75beb6f68dfaf4343c87f8"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a20ee41eb7e75beb6f68dfaf4343c87f8">SetOwner</a> (std::function&lt; void()&gt; fun) final</td></tr>
<tr class="memdesc:a20ee41eb7e75beb6f68dfaf4343c87f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">指定事件响应函数，  <br /></td></tr>
<tr class="separator:a20ee41eb7e75beb6f68dfaf4343c87f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5761b4045da691f1b4be219414eb4d65" id="r_a5761b4045da691f1b4be219414eb4d65"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="../../d2/d38/structi_timer.html#a31bdd3250ca6c5542d0ec156bd82c5ab">emErrCode</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a5761b4045da691f1b4be219414eb4d65">Stop</a> () final</td></tr>
<tr class="memdesc:a5761b4045da691f1b4be219414eb4d65"><td class="mdescLeft">&#160;</td><td class="mdescRight">停止计时器  <br /></td></tr>
<tr class="separator:a5761b4045da691f1b4be219414eb4d65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aceb8aba559f06550a0f9246091925410" id="r_aceb8aba559f06550a0f9246091925410"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aceb8aba559f06550a0f9246091925410">IsRuning</a> () final</td></tr>
<tr class="memdesc:aceb8aba559f06550a0f9246091925410"><td class="mdescLeft">&#160;</td><td class="mdescRight">判断计时器是否正在运行  <br /></td></tr>
<tr class="separator:aceb8aba559f06550a0f9246091925410"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a756d1d8625064baaee44224298396633" id="r_a756d1d8625064baaee44224298396633"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="../../d2/d38/structi_timer.html#a31bdd3250ca6c5542d0ec156bd82c5ab">emErrCode</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a756d1d8625064baaee44224298396633">Reset</a> () final</td></tr>
<tr class="memdesc:a756d1d8625064baaee44224298396633"><td class="mdescLeft">&#160;</td><td class="mdescRight">复位计时，让计时器从零开始计时  <br /></td></tr>
<tr class="separator:a756d1d8625064baaee44224298396633"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9da570f1136b3a5f7b958077a58a72ae" id="r_a9da570f1136b3a5f7b958077a58a72ae"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9da570f1136b3a5f7b958077a58a72ae">setTick</a> (long t) final</td></tr>
<tr class="separator:a9da570f1136b3a5f7b958077a58a72ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-attribs" name="pub-static-attribs"></a>
静态 Public 属性</h2></td></tr>
<tr class="memitem:af7763b65d759068c4d779fae8ef4171d" id="r_af7763b65d759068c4d779fae8ef4171d"><td class="memItemLeft" align="right" valign="top">static std::map&lt; MMRESULT, <a class="el" href="../../dc/da9/classwin_timer.html">winTimer</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#af7763b65d759068c4d779fae8ef4171d">gTimerRecord</a></td></tr>
<tr class="separator:af7763b65d759068c4d779fae8ef4171d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="friends" name="friends"></a>
友元</h2></td></tr>
<tr class="memitem:a985d85e5d3680397f9cb5bd9871954f4" id="r_a985d85e5d3680397f9cb5bd9871954f4"><td class="memItemLeft" align="right" valign="top">void CALLBACK&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a985d85e5d3680397f9cb5bd9871954f4">on_win_timer</a> (UINT id, UINT msg, DWORD_PTR, void *duser, DWORD_PTR dw1, DWORD_PTR dw2)</td></tr>
<tr class="separator:a985d85e5d3680397f9cb5bd9871954f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="inherited" name="inherited"></a>
额外继承的成员函数</h2></td></tr>
<tr class="inherit_header pub_types_structi_timer"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_types_structi_timer')"><img src="../../closed.png" alt="-"/>&#160;Public 类型 继承自 <a class="el" href="../../d2/d38/structi_timer.html">iTimer</a></td></tr>
<tr class="memitem:a31bdd3250ca6c5542d0ec156bd82c5ab inherit pub_types_structi_timer" id="r_a31bdd3250ca6c5542d0ec156bd82c5ab"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d38/structi_timer.html#a31bdd3250ca6c5542d0ec156bd82c5ab">emErrCode</a> { <br />
&#160;&#160;<a class="el" href="../../d2/d38/structi_timer.html#a31bdd3250ca6c5542d0ec156bd82c5abaa09563b77a12d14f77018d048ce4d6fb">ERR_CREATE_TIMER</a> = -1000
, <a class="el" href="../../d2/d38/structi_timer.html#a31bdd3250ca6c5542d0ec156bd82c5aba411cbed936ceec95393a481fd39d6cef">ERR_MISSING_INFO_FUN</a>
, <a class="el" href="../../d2/d38/structi_timer.html#a31bdd3250ca6c5542d0ec156bd82c5aba69bdc858844fbe024b1459b4d869e2a7">ERR_START_TIMER</a>
, <a class="el" href="../../d2/d38/structi_timer.html#a31bdd3250ca6c5542d0ec156bd82c5aba9d8d590f2b964254d8190d547b882fde">ERR_STOP_TIMER</a>
, <br />
&#160;&#160;<a class="el" href="../../d2/d38/structi_timer.html#a31bdd3250ca6c5542d0ec156bd82c5aba4033ecbc2c2e7418fd4f2d5e62159d6c">ERR_TICK</a>
, <a class="el" href="../../d2/d38/structi_timer.html#a31bdd3250ca6c5542d0ec156bd82c5aba74f5e1cb5939af592e4e7c06a3406e9e">OK</a> = 0
<br />
 }</td></tr>
<tr class="separator:a31bdd3250ca6c5542d0ec156bd82c5ab inherit pub_types_structi_timer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_static_methods_structi_timer"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_static_methods_structi_timer')"><img src="../../closed.png" alt="-"/>&#160;静态 Public 成员函数 继承自 <a class="el" href="../../d2/d38/structi_timer.html">iTimer</a></td></tr>
<tr class="memitem:ae0b9a3f6caa6ae2a56bd06898da25ce1 inherit pub_static_methods_structi_timer" id="r_ae0b9a3f6caa6ae2a56bd06898da25ce1"><td class="memItemLeft" align="right" valign="top">static std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d38/structi_timer.html#ae0b9a3f6caa6ae2a56bd06898da25ce1">errMsg</a> (<a class="el" href="../../d2/d38/structi_timer.html#a31bdd3250ca6c5542d0ec156bd82c5ab">emErrCode</a> e)</td></tr>
<tr class="separator:ae0b9a3f6caa6ae2a56bd06898da25ce1 inherit pub_static_methods_structi_timer"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>针对windows实现的timer </p>
<dl class="section version"><dt>版本</dt><dd>1.0 </dd></dl>
<dl class="section author"><dt>作者</dt><dd>宋炜 </dd></dl>
<dl class="section date"><dt>日期</dt><dd>2021-11-1 </dd></dl>

<p class="definition">在文件 <a class="el" href="../../d1/da6/win_timer_8hpp_source.html">winTimer.hpp</a> 第 <a class="el" href="../../d1/da6/win_timer_8hpp_source.html#l00020">20</a> 行定义.</p>
</div><h2 class="groupheader">构造及析构函数说明</h2>
<a id="a14a1016e75bbce66e1e81223ebf97665" name="a14a1016e75bbce66e1e81223ebf97665"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a14a1016e75bbce66e1e81223ebf97665">&#9670;&#160;</a></span>winTimer() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">winTimer::winTimer </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../dd/da0/win_timer_8cpp_source.html">winTimer.cpp</a> 第 <a class="el" href="../../dd/da0/win_timer_8cpp_source.html#l00020">20</a> 行定义.</p>

</div>
</div>
<a id="a4dd755c4a63913f5a538bef27c8db26e" name="a4dd755c4a63913f5a538bef27c8db26e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4dd755c4a63913f5a538bef27c8db26e">&#9670;&#160;</a></span>winTimer() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">winTimer::winTimer </td>
          <td>(</td>
          <td class="paramtype">long</td>          <td class="paramname"><span class="paramname"><em>ms</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>oneShot</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../dd/da0/win_timer_8cpp_source.html">winTimer.cpp</a> 第 <a class="el" href="../../dd/da0/win_timer_8cpp_source.html#l00027">27</a> 行定义.</p>

</div>
</div>
<a id="a61095eb931b08bc8dfce2c8eecce4962" name="a61095eb931b08bc8dfce2c8eecce4962"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a61095eb931b08bc8dfce2c8eecce4962">&#9670;&#160;</a></span>winTimer() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">winTimer::winTimer </td>
          <td>(</td>
          <td class="paramtype">std::function&lt; void()&gt;</td>          <td class="paramname"><span class="paramname"><em>fun</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long</td>          <td class="paramname"><span class="paramname"><em>ms</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>onShot</em></span><span class="paramdefsep"> = </span><span class="paramdefval">false</span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../dd/da0/win_timer_8cpp_source.html">winTimer.cpp</a> 第 <a class="el" href="../../dd/da0/win_timer_8cpp_source.html#l00034">34</a> 行定义.</p>

</div>
</div>
<a id="acf8ffcaf3863e53e1d0a46e661b038d6" name="acf8ffcaf3863e53e1d0a46e661b038d6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acf8ffcaf3863e53e1d0a46e661b038d6">&#9670;&#160;</a></span>~winTimer()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">winTimer::~winTimer </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/da6/win_timer_8hpp_source.html">winTimer.hpp</a> 第 <a class="el" href="../../d1/da6/win_timer_8hpp_source.html#l00058">58</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="../../dc/da9/classwin_timer_acf8ffcaf3863e53e1d0a46e661b038d6_cgraph.png" border="0" usemap="#adc/da9/classwin_timer_acf8ffcaf3863e53e1d0a46e661b038d6_cgraph" alt=""/></div>
<map name="adc/da9/classwin_timer_acf8ffcaf3863e53e1d0a46e661b038d6_cgraph" id="adc/da9/classwin_timer_acf8ffcaf3863e53e1d0a46e661b038d6_cgraph">
<area shape="rect" title=" " alt="" coords="5,5,149,32"/>
<area shape="rect" href="../../dc/da9/classwin_timer.html#a5761b4045da691f1b4be219414eb4d65" title="停止计时器" alt="" coords="197,5,306,32"/>
<area shape="poly" title=" " alt="" coords="149,16,181,16,181,21,149,21"/>
</map>
</div>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a id="aceb8aba559f06550a0f9246091925410" name="aceb8aba559f06550a0f9246091925410"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aceb8aba559f06550a0f9246091925410">&#9670;&#160;</a></span>IsRuning()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool winTimer::IsRuning </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>判断计时器是否正在运行 </p>

<p>实现了 <a class="el" href="../../d2/d38/structi_timer.html#abea86b75a4bcc2399821b799e221b9ce">iTimer</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dd/da0/win_timer_8cpp_source.html">winTimer.cpp</a> 第 <a class="el" href="../../dd/da0/win_timer_8cpp_source.html#l00093">93</a> 行定义.</p>

</div>
</div>
<a id="af4ecf02c7dd3950a074813f12654b6a1" name="af4ecf02c7dd3950a074813f12654b6a1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af4ecf02c7dd3950a074813f12654b6a1">&#9670;&#160;</a></span>operator()() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">long winTimer::operator() </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置和获取计时器计时长度 </p>

<p class="definition">在文件 <a class="el" href="../../d1/da6/win_timer_8hpp_source.html">winTimer.hpp</a> 第 <a class="el" href="../../d1/da6/win_timer_8hpp_source.html#l00067">67</a> 行定义.</p>

</div>
</div>
<a id="a1f51621daa57a92e70b44e65ed2d6556" name="a1f51621daa57a92e70b44e65ed2d6556"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1f51621daa57a92e70b44e65ed2d6556">&#9670;&#160;</a></span>operator()() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void winTimer::operator() </td>
          <td>(</td>
          <td class="paramtype">long</td>          <td class="paramname"><span class="paramname"><em>t</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/da6/win_timer_8hpp_source.html">winTimer.hpp</a> 第 <a class="el" href="../../d1/da6/win_timer_8hpp_source.html#l00071">71</a> 行定义.</p>

</div>
</div>
<a id="a756d1d8625064baaee44224298396633" name="a756d1d8625064baaee44224298396633"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a756d1d8625064baaee44224298396633">&#9670;&#160;</a></span>Reset()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d2/d38/structi_timer.html#a31bdd3250ca6c5542d0ec156bd82c5ab">iTimer::emErrCode</a> winTimer::Reset </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>复位计时，让计时器从零开始计时 </p>

<p>实现了 <a class="el" href="../../d2/d38/structi_timer.html#ad51fd07ebb8585928243674cb21e80e0">iTimer</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dd/da0/win_timer_8cpp_source.html">winTimer.cpp</a> 第 <a class="el" href="../../dd/da0/win_timer_8cpp_source.html#l00100">100</a> 行定义.</p>

</div>
</div>
<a id="a20ee41eb7e75beb6f68dfaf4343c87f8" name="a20ee41eb7e75beb6f68dfaf4343c87f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a20ee41eb7e75beb6f68dfaf4343c87f8">&#9670;&#160;</a></span>SetOwner()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void winTimer::SetOwner </td>
          <td>(</td>
          <td class="paramtype">std::function&lt; void()&gt;</td>          <td class="paramname"><span class="paramname"><em>fun</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>指定事件响应函数， </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">fun</td><td>，事件响应的函数对象，使用std::bind完成或者直接指定函数对象 </td></tr>
  </table>
  </dd>
</dl>

<p>实现了 <a class="el" href="../../d2/d38/structi_timer.html#aa51cbfaef39ee9841c24ff65ce720acc">iTimer</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dd/da0/win_timer_8cpp_source.html">winTimer.cpp</a> 第 <a class="el" href="../../dd/da0/win_timer_8cpp_source.html#l00071">71</a> 行定义.</p>

</div>
</div>
<a id="a9da570f1136b3a5f7b958077a58a72ae" name="a9da570f1136b3a5f7b958077a58a72ae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9da570f1136b3a5f7b958077a58a72ae">&#9670;&#160;</a></span>setTick()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void winTimer::setTick </td>
          <td>(</td>
          <td class="paramtype">long</td>          <td class="paramname"><span class="paramname"><em>t</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>实现了 <a class="el" href="../../d2/d38/structi_timer.html#a3aaa71906aca3939acf219852b2d36d9">iTimer</a>.</p>

<p class="definition">在文件 <a class="el" href="../../d1/da6/win_timer_8hpp_source.html">winTimer.hpp</a> 第 <a class="el" href="../../d1/da6/win_timer_8hpp_source.html#l00098">98</a> 行定义.</p>

</div>
</div>
<a id="a8e3b9ffad7b759f2df399d8d222808cb" name="a8e3b9ffad7b759f2df399d8d222808cb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8e3b9ffad7b759f2df399d8d222808cb">&#9670;&#160;</a></span>Start()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d2/d38/structi_timer.html#a31bdd3250ca6c5542d0ec156bd82c5ab">iTimer::emErrCode</a> winTimer::Start </td>
          <td>(</td>
          <td class="paramtype">long</td>          <td class="paramname"><span class="paramname"><em>ms</em></span><span class="paramdefsep"> = </span><span class="paramdefval">-1</span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>oneShot</em></span><span class="paramdefsep"> = </span><span class="paramdefval">false</span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>启动或者重启计时器。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">ms</td><td>， 计时时长，单位ms，当ms小于0的时候，使用就计时时长启动计时器 </td></tr>
    <tr><td class="paramname">oneShot</td><td>， 是否单次计时，true单次计时，否则连续计时 </td></tr>
  </table>
  </dd>
</dl>

<p>实现了 <a class="el" href="../../d2/d38/structi_timer.html#a0bd87be9906e599b0776fc592cf81f9c">iTimer</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dd/da0/win_timer_8cpp_source.html">winTimer.cpp</a> 第 <a class="el" href="../../dd/da0/win_timer_8cpp_source.html#l00043">43</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="../../dc/da9/classwin_timer_a8e3b9ffad7b759f2df399d8d222808cb_cgraph.png" border="0" usemap="#adc/da9/classwin_timer_a8e3b9ffad7b759f2df399d8d222808cb_cgraph" alt=""/></div>
<map name="adc/da9/classwin_timer_a8e3b9ffad7b759f2df399d8d222808cb_cgraph" id="adc/da9/classwin_timer_a8e3b9ffad7b759f2df399d8d222808cb_cgraph">
<area shape="rect" title="启动或者重启计时器。" alt="" coords="5,5,116,32"/>
<area shape="rect" href="../../dd/da0/win_timer_8cpp.html#a985d85e5d3680397f9cb5bd9871954f4" title=" " alt="" coords="164,5,262,32"/>
<area shape="poly" title=" " alt="" coords="116,16,148,16,148,21,116,21"/>
</map>
</div>

</div>
</div>
<a id="a5761b4045da691f1b4be219414eb4d65" name="a5761b4045da691f1b4be219414eb4d65"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5761b4045da691f1b4be219414eb4d65">&#9670;&#160;</a></span>Stop()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d2/d38/structi_timer.html#a31bdd3250ca6c5542d0ec156bd82c5ab">iTimer::emErrCode</a> winTimer::Stop </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">final</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>停止计时器 </p>

<p>实现了 <a class="el" href="../../d2/d38/structi_timer.html#a38cfdd65a88c39d24e2ddc3ceeebda2e">iTimer</a>.</p>

<p class="definition">在文件 <a class="el" href="../../dd/da0/win_timer_8cpp_source.html">winTimer.cpp</a> 第 <a class="el" href="../../dd/da0/win_timer_8cpp_source.html#l00077">77</a> 行定义.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="../../dc/da9/classwin_timer_a5761b4045da691f1b4be219414eb4d65_icgraph.png" border="0" usemap="#adc/da9/classwin_timer_a5761b4045da691f1b4be219414eb4d65_icgraph" alt=""/></div>
<map name="adc/da9/classwin_timer_a5761b4045da691f1b4be219414eb4d65_icgraph" id="adc/da9/classwin_timer_a5761b4045da691f1b4be219414eb4d65_icgraph">
<area shape="rect" title="停止计时器" alt="" coords="197,5,306,32"/>
<area shape="rect" href="../../dc/da9/classwin_timer.html#acf8ffcaf3863e53e1d0a46e661b038d6" title=" " alt="" coords="5,5,149,32"/>
<area shape="poly" title=" " alt="" coords="181,21,149,21,149,16,181,16"/>
</map>
</div>

</div>
</div>
<h2 class="groupheader">友元及相关符号说明</h2>
<a id="a985d85e5d3680397f9cb5bd9871954f4" name="a985d85e5d3680397f9cb5bd9871954f4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a985d85e5d3680397f9cb5bd9871954f4">&#9670;&#160;</a></span>on_win_timer</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void CALLBACK on_win_timer </td>
          <td>(</td>
          <td class="paramtype">UINT</td>          <td class="paramname"><span class="paramname"><em>id</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">UINT</td>          <td class="paramname"><span class="paramname"><em>msg</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">DWORD_PTR</td>          <td class="paramname"><span class="paramname"><em></em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *</td>          <td class="paramname"><span class="paramname"><em>duser</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">DWORD_PTR</td>          <td class="paramname"><span class="paramname"><em>dw1</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">DWORD_PTR</td>          <td class="paramname"><span class="paramname"><em>dw2</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../dd/da0/win_timer_8cpp_source.html">winTimer.cpp</a> 第 <a class="el" href="../../dd/da0/win_timer_8cpp_source.html#l00009">9</a> 行定义.</p>

</div>
</div>
<h2 class="groupheader">类成员变量说明</h2>
<a id="af7763b65d759068c4d779fae8ef4171d" name="af7763b65d759068c4d779fae8ef4171d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af7763b65d759068c4d779fae8ef4171d">&#9670;&#160;</a></span>gTimerRecord</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::map&lt; MMRESULT, <a class="el" href="../../dc/da9/classwin_timer.html">winTimer</a> * &gt; winTimer::gTimerRecord</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../d1/da6/win_timer_8hpp_source.html">winTimer.hpp</a> 第 <a class="el" href="../../d1/da6/win_timer_8hpp_source.html#l00040">40</a> 行定义.</p>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>include/details/<a class="el" href="../../d1/da6/win_timer_8hpp_source.html">winTimer.hpp</a></li>
<li>src/details/<a class="el" href="../../dd/da0/win_timer_8cpp_source.html">winTimer.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
